====================
1. Run d/make_orig_multi.sh <version>.
-2. Verify the -deps component tarball to make sure it looks good.
+2. Verify the -vendor component tarball to make sure it looks good.
If not, edit d/make_orig_multi.sh and the surrounding files (such as patches
and exclude files) and repeat the above until it looks good.
3. $ git fetch upstream
$ git remote add upstream https://github.com/rust-lang/cargo
4. $ gbp import-orig ../cargo_<version>.orig.tar.gz
If you get errors, check the extra default flags in d/gbp.conf
-5. Check that no old versions remain in deps/. If there are, then your git repo
- was messed up when you ran (4). Rewind the debian/sid, upstream, and
+5. Check that no old versions remain in vendor/. If there are, then your git
+ repo was messed up when you ran (4). Rewind the debian/sid, upstream, and
pristine-tar branches, delete the upstream/<version> tag; this reverts step
(4). Clean up your git repo, and then try (4) again.
6. Update d/patches and the rest of the packaging, as normal.
As such, the original source is composed by two tarballs:
* cargo source
- * dependencies crates (under deps/), stripped of unused embedded
+ * dependencies crates (under vendor/), stripped of unused embedded
C libraries
-- Luca Bruno <lucab@debian.org> Sat, 13 Feb 2016 17:50:59 +0100
#!/usr/bin/env python
"""
+NOTE: This script has not been used for a very long time and very likely won't
+work. Please read the code before attempting to run it and hoping that "just
+fixing the errors" will work. -- infinity0
+
About
=====
+++ /dev/null
-#!/usr/bin/env python3
-
-# Copyright: 2015 The Debian Project
-# License: MIT-License or Apache-2.0
-#
-# Helper to unpack a local crate registry to original sources
-# TODO: rewrite to perl and add to dh-cargo, maybe?
-
-import os
-import tarfile
-
-def main():
- curdir = os.getcwd()
- depsdir = os.path.join(curdir, "deps")
- vendordir = os.path.join(curdir, "vendor")
- cachedir = os.path.join(vendordir, "cache")
- if not os.path.exists(depsdir):
- os.makedirs(depsdir)
-
- for _, names, _ in os.walk(top=cachedir):
- for cratename in names:
- for _, vers, _ in os.walk(top=os.path.join(cachedir, cratename)):
- for cratever in vers:
- crate = os.path.join(cachedir, cratename, cratever, "download")
- tar = tarfile.open(crate)
- tar.extractall(path=depsdir)
- print("Unpacking crate deps %s" % crate)
- tar.close()
-
-
-if __name__ == "__main__":
- main()
+cargo (0.17.0-1~exp2) UNRELEASED; urgency=medium
+
+ * Bring in some changes from Ubuntu.
+ - Rename deps/ to vendor/ as that's what upstream uses, and update
+ other files with the new paths too.
+ - Remove cargo-vendor-unpack since we no longer need to postprocess
+ cargo-vendor output in that way.
+ * Document that bootstrap.py probably doesn't work now.
+ * Include /usr/share/rustc/architecture.mk in d/rules instead of duplicating
+ awkward arch-dependent Makefile snippets.
+ * Don't embed libgit2, add a versioned B-D to libgit2-dev.
+
+ -- Ximin Luo <infinity0@debian.org> Mon, 01 May 2017 16:38:43 +0200
+
cargo (0.17.0-1~exp1) experimental; urgency=medium
* New upstream release. (Closes: #851089, #859312)
Priority: extra
Build-Depends: debhelper (>= 9.20141010),
dpkg-dev (>= 1.17.14),
- rustc (>= 1.13),
+ rustc (>= 1.16),
pkg-config,
cmake,
cargo (>= 0.7.0) <!pkg.cargo.mkstage0>,
bash-completion,
libcurl4-gnutls-dev | libcurl4-openssl-dev,
libssh2-1-dev,
- libgit2-dev,
+ libgit2-dev (>= 0.25.1),
libhttp-parser-dev,
libssl-dev,
zlib1g-dev
notice may not be copied, modified, or distributed except
according to those terms.
-Files: deps/*
- deps/time-*
- deps/libc-*
- deps/bitflags-*
- deps/semver-*
- deps/log-*
- deps/glob-*
- deps/env_logger-*
- deps/rustc-*
- deps/term-*
- deps/rustc-serialize-*
- deps/regex-*
+Files: vendor/*
+ vendor/time-*
+ vendor/libc-*
+ vendor/bitflags-*
+ vendor/semver-*
+ vendor/log-*
+ vendor/glob-*
+ vendor/env_logger-*
+ vendor/rustc-*
+ vendor/term-*
+ vendor/rustc-serialize-*
+ vendor/regex-*
Copyright: 2014-2015 The Rust Project Developers
License: MIT-License or Apache-2.0
Comment:
same MIT/Apache-2.0 dual-license. See https://github.com/rust-lang.
Exceptions are noted below.
-Files: deps/advapi32-sys-*
- deps/kernel32-*
- deps/winapi-*
+Files: vendor/advapi32-sys-*
+ vendor/kernel32-*
+ vendor/winapi-*
Copyright: 2015 Peter Atashian <retep998@gmail.com>
License: MIT-License
Comment: see https://github.com/retep998/winapi-rs
-Files: deps/url-*
+Files: vendor/url-*
Copyright: 2015 Simon Sapin <simon.sapin@exyr.org>
License: MIT-License or Apache-2.0
Comment: see https://github.com/servo/rust-url
-Files: deps/matches-*
+Files: vendor/matches-*
Copyright: 2015 Simon Sapin <simon.sapin@exyr.org>
License: MIT-License
Comment: see https://github.com/SimonSapin/rust-std-candidates
-Files: deps/num_cpus-*
+Files: vendor/num_cpus-*
Copyright: 2015 Sean McArthur <sean.monstar@gmail.com>
License: MIT-License
Comment: see https://github.com/seanmonstar/num_cpus
-Files: deps/strsim-*
+Files: vendor/strsim-*
Copyright: 2015 Danny Guo <dannyguo91@gmail.com>
License: MIT-License
Comment: see https://github.com/dguo/strsim-rs
-Files: deps/memchr-*
- deps/aho-corasick-*
- deps/docopt-*
+Files: vendor/memchr-*
+ vendor/aho-corasick-*
+ vendor/docopt-*
Copyright: 2015 Andrew Gallant <jamslam@gmail.com>
License: MIT-License or Unlicense
Comment: see upstream projects,
* https://github.com/BurntSushi/aho-corasick
* https://github.com/docopt/docopt.rs
-Files: deps/openssl-sys-*
+Files: vendor/openssl-sys-*
Copyright: 2015 Alex Crichton <alex@alexcrichton.com>
2015 Steven Fackler <sfackler@gmail.com>
License: MIT-License
Comment: see https://github.com/sfackler/rust-openssl
-Files: deps/libz-sys-*
- deps/libgit2-sys-*
- deps/libssh2-sys-*
- deps/miniz-sys-*
- deps/gcc-*
- deps/git2-*
- deps/git2-curl-*
- deps/filetime-*
- deps/flate2-*
- deps/pkg-config-*
- deps/toml-*
- deps/tar-*
+Files: vendor/libz-sys-*
+ vendor/libgit2-sys-*
+ vendor/libssh2-sys-*
+ vendor/miniz-sys-*
+ vendor/gcc-*
+ vendor/git2-*
+ vendor/git2-curl-*
+ vendor/filetime-*
+ vendor/flate2-*
+ vendor/pkg-config-*
+ vendor/toml-*
+ vendor/tar-*
Copyright: 2014-2015 Alex Crichton <alex@alexcrichton.com>
License: MIT-License or Apache-2.0
Comment: see https://github.com/alexcrichton/
-Files: deps/miniz-sys-*/miniz.c
+Files: vendor/miniz-sys-*/miniz.c
Copyright: Rich Geldreich <richgel99@gmail.com>
License: Unlicense
-Files: deps/libgit2-sys-*/libgit2/*
+Files: vendor/libgit2-sys-*/libgit2/*
Copyright: 2009-2012, the libgit2 contributors
License: GPL-2 with linking exception
-Files: deps/libgit2-sys-*/libgit2/cmake/Modules/FindGSSAPI.cmake
+Files: vendor/libgit2-sys-*/libgit2/cmake/Modules/FindGSSAPI.cmake
Copyright: 2013, Andreas Schneider <asn@cryptomilk.org>
License: BSD-2-clause
-Files: deps/libgit2-sys-*/libgit2/include/git2/inttypes.h
- deps/libgit2-sys-*/libgit2/include/git2/stdint.h
+Files: vendor/libgit2-sys-*/libgit2/include/git2/inttypes.h
+ vendor/libgit2-sys-*/libgit2/include/git2/stdint.h
Copyright: 2006, Alexander Chemeris
License: BSD-3-clause
-Files: deps/libgit2-sys-*/libgit2/src/khash.h
+Files: vendor/libgit2-sys-*/libgit2/src/khash.h
Copyright: 2008, 2009, 2011, Attractive Chaos <attractor@live.co.uk>
License: MIT-License
-Files: deps/libgit2-sys-*/libgit2/src/xdiff/*
+Files: vendor/libgit2-sys-*/libgit2/src/xdiff/*
Copyright: 2003-2006, Davide Libenzi
2003-2006, Johannes E. Schindelin
License: LGPL-2.1+
-Files: deps/libgit2-sys-*/libgit2/src/xdiff/xhistogram.c
+Files: vendor/libgit2-sys-*/libgit2/src/xdiff/xhistogram.c
Copyright: 2010, Google Inc and others from JGit's IP log.
License: EDL-1.0
-Files: deps/libgit2-sys-*/libgit2/src/date.c
+Files: vendor/libgit2-sys-*/libgit2/src/date.c
Copyright: 2005, Linus Torvalds
License: GPL-2 with linking exception
+++ /dev/null
-# This is a list of files and dirs that should be filtered from
-# deps tarball for copyright/duplication reasons
-curl-sys-*/curl/
-libgit2-sys-*/libgit2/deps/
-libgit2-sys-*/libgit2/examples/
-libgit2-sys-*/libgit2/tests/
-libssh2-sys-*/libssh2*/
-libz-sys-*/src/zlib-*/
-strsim-*/docs/
-
-# To clean deps before making a new tarball, run
-# grep -v '^#' debian/deps-tarball-filter.txt | xargs -I% sh -c 'rm -rf %'
+++ /dev/null
-# This is a list of files and dirs that are omitted from our custom
-# "suspicious files" scanner
-
-# test data
-flate2-*/tests/
-tar-*/tests/archives/
-term-*/tests/data/
-toml-*/tests/
-
-# misc support data
-hamcrest-*/LICENSE-*
-*/.travis.yml
-# "build status" link-images etc take up a lot of line-length
-*/README.md
-
-# individual files, manually audited:
-idna-*/tests/IdnaTest.txt
-idna-*/src/uts46_mapping_table.rs
-regex-*/src/testdata/basic.dat
-regex-*/tests/fowler.rs
-libgit2-sys-*/libgit2/src/openssl_stream.c
-term-*/scripts/id_rsa.enc
-url-*/github.png
-num-*/doc/favicon.ico
-num-*/doc/rust-logo-128x128-blk-v2.png
-num-*/.travis/deploy.enc
-miniz-sys-*/miniz.c
-docopt-*/src/test/testcases.rs
-winapi-*/src/winnt.rs
debian-tag = debian/%(version)s
pristine-tar = True
upstream-branch = upstream
-debian-branch = debian/sid
[buildpackage]
submodules = True
[import-orig]
upstream-vcs-tag = %(version)s
-component = deps
+component = vendor
+debian-branch = debian/experimental
fi;
BOOTSTRAP_PY=$(find "${PWD}" -name bootstrap.py -type f)
-DEPS_FILTER=$(find "${PWD}" -name deps-tarball-filter.txt -type f)
-DEPS_SUS_WHITELIST=$(find "${PWD}" -name deps-tarball-unsuspicious.txt -type f)
+VENDOR_FILTER=$(find "${PWD}" -name vendor-tarball-filter.txt -type f)
+VENDOR_SUS_WHITELIST=$(find "${PWD}" -name vendor-tarball-unsuspicious.txt -type f)
# Download cargo tarball
uscan --rename ${USCAN_ARGS} --force-download --destdir "${TMPDIR}/"
export GIT_AUTHOR_EMAIL="<>"
export GIT_COMMITTER_NAME="${GIT_AUTHOR_NAME}"
export GIT_COMMITTER_EMAIL="${GIT_AUTHOR_EMAIL}"
-cargo vendor --explicit-version --verbose deps
+cargo vendor --explicit-version --verbose
-# Unpack artifacts and clean embedded libs
-${WORKDIR}/debian/cargo-vendor-unpack.py
-grep -v '^#' ${DEPS_FILTER} | xargs -I% sh -c 'rm -rf deps/%'
-for i in deps/*; do ${WORKDIR}/debian/cargo-checksums-prune.py "$i"; done
+# Clean embedded libs and update checksums
+grep -v '^#' ${VENDOR_FILTER} | xargs -I% sh -c 'rm -rf vendor/%'
+for i in vendor/*; do ${WORKDIR}/debian/cargo-checksums-prune.py "$i"; done
# Report any suspicious files
-cp -R deps deps-scan
-grep -v '^#' ${DEPS_SUS_WHITELIST} | xargs -I% sh -c 'rm -rf deps-scan/%'
+cp -R vendor vendor-scan
+grep -v '^#' ${VENDOR_SUS_WHITELIST} | xargs -I% sh -c 'rm -rf vendor-scan/%'
echo "Checking for suspicious files..."
# The following shell snippet is a bit more strict than suspicious-source(1)
-find deps-scan -type f -and -not -name '.cargo-checksum.json' -exec file '{}' \; | \
+find vendor-scan -type f -and -not -name '.cargo-checksum.json' -exec file '{}' \; | \
sed -e 's/\btext\b\(.*\), with very long lines/verylongtext\1/g' | \
grep -v '\b\(text\|empty\)\b' || true
echo "The above files (if any) seem suspicious, please audit them."
-echo "If good, add them to ${DEPS_SUS_WHITELIST}."
-echo "If bad, add them to ${DEPS_FILTER}."
-rm -rf deps-scan
+echo "If good, add them to ${VENDOR_SUS_WHITELIST}."
+echo "If bad, add them to ${VENDOR_FILTER}."
+rm -rf vendor-scan
# Pack it up, reproducibly
GZIP=-9n tar --sort=name \
--mtime="./Cargo.lock" \
--owner=root --group=root \
- -czf "${TMPDIR}/cargo_${CARGO_VER}.orig-deps.tar.gz" deps
+ -czf "${TMPDIR}/cargo_${CARGO_VER}.orig-vendor.tar.gz" vendor
# All is good, we are done!
echo "Your files are available at:"
echo "${TMPDIR}/cargo_${CARGO_VER}.orig.tar.gz \\"
-echo "${TMPDIR}/cargo_${CARGO_VER}.orig-deps.tar.gz"
+echo "${TMPDIR}/cargo_${CARGO_VER}.orig-vendor.tar.gz"
echo ""
echo "Unpacked cargo sources are available under:"
echo "${TMPDIR}/cargo/"
include /usr/share/dpkg/pkg-info.mk
include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/buildflags.mk
+include /usr/share/rustc/architecture.mk
+
RUSTFLAGS += $(foreach flag,$(LDFLAGS),-C link-arg=$(flag))
export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS RUSTFLAGS
-rust_cpu = $(subst i586,i686,$(1))
-DEB_HOST_RUST_TYPE := $(call rust_cpu,$(DEB_HOST_GNU_CPU))-unknown-$(DEB_HOST_GNU_SYSTEM)
-DEB_TARGET_RUST_TYPE := $(call rust_cpu,$(DEB_TARGET_GNU_CPU))-unknown-$(DEB_TARGET_GNU_SYSTEM)
-
# Cargo looks for config in and writes cache to $CARGO_HOME/
export CARGO_HOME = $(CURDIR)/debian/cargohome
# Ask cargo to be verbose when building
export VERBOSE = 1
-DEB_DESTDIR := $(CURDIR)/debian/tmp
-VENDORDIR := $(CURDIR)/vendor
-INDEXDIR := $(CURDIR)/vendor/index
-DEPSDIR := $(CURDIR)/deps
-
%:
dh $@ --with bash-completion
override_dh_auto_configure:
cp -a $(CURDIR)/Cargo.lock $(CURDIR)/.Cargo.lock.orig
ifneq ($(filter pkg.cargo.mkstage0,$(DEB_BUILD_PROFILES)),)
+ # NOTE: this very likely doesn't work any more, see bootstrap.py for details
+ # Instead, you can try to bootstrap by setting PATH to a binary cargo
+ # downloaded from upstream, or by (TODO) cross-compiling.
+ # Preserved in case someone wants to resurrect it later:
# Bootstrap cargo stage0
./debian/bootstrap.py \
--no-clean \
--no-clone \
--no-git \
--no-download \
- --crate-index $(INDEXDIR)/ \
+ --crate-index $(CURDIR)/vendor/index / \
--cargo-root $(CURDIR)/ \
- --target-dir $(DEPSDIR)/ \
+ --target-dir $(CURDIR)/deps \
--host=$(DEB_HOST_RUST_TYPE) \
--target=$(DEB_TARGET_RUST_TYPE)
# Workaround for https://github.com/rust-lang/cargo/issues/1423
- ln -s `find $(DEPSDIR) -name 'cargo-*' -type f -executable` $(CURDIR)/cargo-stage0
+ ln -s `find $(CURDIR)/deps -name 'cargo-*' -type f -executable` $(CURDIR)/cargo-stage0
else
ln -s `which cargo` $(CURDIR)/cargo-stage0
endif
override_dh_auto_clean:
-mv $(CURDIR)/.Cargo.lock.orig $(CURDIR)/Cargo.lock
dh_auto_clean
- -$(RM) -r $(CURDIR)/deps/*.rlib \
- $(CURDIR)/deps/build_script* \
- $(CURDIR)/deps/cargo* \
- $(CURDIR)/deps/*.o \
- $(CURDIR)/target/ \
+ -$(RM) -r $(CURDIR)/target/ \
$(CURDIR)/.cargo \
$(CURDIR)/config.mk \
$(CURDIR)/config.stamp \
$(CURDIR)/Makefile \
- $(CURDIR)/cargo-stage0 \
- $(VENDORDIR)
+ $(CURDIR)/cargo-stage0
--- /dev/null
+# This is a list of files and dirs that should be filtered from
+# deps tarball for copyright/duplication reasons
+curl-sys-*/curl/
+libgit2-sys-*/libgit2*/
+libssh2-sys-*/libssh2*/
+libz-sys-*/src/zlib-*/
+strsim-*/docs/
+
+# To clean deps before making a new tarball, run
+# grep -v '^#' debian/deps-tarball-filter.txt | xargs -I% sh -c 'rm -rf %'
--- /dev/null
+# This is a list of files and dirs that are omitted from our custom
+# "suspicious files" scanner
+
+# test data
+flate2-*/tests/
+tar-*/tests/archives/
+term-*/tests/data/
+toml-*/tests/
+
+# misc support data
+hamcrest-*/LICENSE-*
+*/.travis.yml
+# "build status" link-images etc take up a lot of line-length
+*/README.md
+
+# individual files, manually audited:
+idna-*/tests/IdnaTest.txt
+idna-*/src/uts46_mapping_table.rs
+regex-*/src/testdata/basic.dat
+regex-*/tests/fowler.rs
+libgit2-sys-*/libgit2/src/openssl_stream.c
+term-*/scripts/id_rsa.enc
+url-*/github.png
+num-*/doc/favicon.ico
+num-*/doc/rust-logo-128x128-blk-v2.png
+num-*/.travis/deploy.enc
+miniz-sys-*/miniz.c
+docopt-*/src/test/testcases.rs
+winapi-*/src/winnt.rs